home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 7: Sunsite
/
Linux Cubed Series 7 - Sunsite Vol 1.iso
/
system
/
serial
/
zyxel-1.5
/
zyxel-1
/
usr
/
ZyXEL
/
README
< prev
next >
Wrap
Text File
|
1995-02-04
|
51KB
|
1,263 lines
######### # # ######### #
# # # # #
## # # # # # #
# # # ### ####### #
## # # # # # #
# # # # # # #
######### ###### # # ######### #########
#
#
#####
A control program for the ZyXEL U-1496 series MODEMs for use with the
Linux operating system (and other UNIX-like systems)
This program manages the use of the ZyXEL MODEM for:
- dial-in, for use by "uucp" and other programs started from
a login
- dial-in security (checking username and password)
- dial-back security
- dial-out, e.g. using "cu", "uucp" or "seyon"
- receiving FAXes
- sending FAXes
- polling for FAXes
- handling incoming FAX polls
- answering machine (voice mailbox)
Everything is done in a single program, to keep things simple
and fast. Multi-program solutions are available from others.
(e.g. modgetty, mgetty+sendfax)
Copyright 1993-1995 by Rob Janssen, PE1CHL
This program uses parts of "getty_ps", written by Paul Sutcliffe:
Copyright 1989,1990 by Paul Sutcliffe Jr.
Permission is hereby granted to copy, reproduce, redistribute,
or otherwise use this software as long as: there is no monetary
profit gained specifically from the use or reproduction or this
software, it is not sold, rented, traded or otherwise marketed,
and this copyright notice is included prominently in any copy
made.
The author make no claims as to the fitness or correctness of
this software for any use whatsoever, and it is provided as is.
Any use of this software is at the user's own risk.
Info for those who upgrade from an earlier version
--------------------------------------------------
This release has some major changes relative to 1.4
When you have used 1.4 or earlier versions, please note the following:
- the extension of VOICE files has been changed from .zvd to .zad
this was done because the same change was made in ZFAX, ZyXEL's
DOS program for support of the modem.
rename any .zvd files you have in the "play", "record" and "archive"
directories (as well as anywhere else) from the .zvd to the .zad
extension for compatability with this release of ZyXEL.
- the programming of actions taken on DTMF input in the voice mailbox is
now more versatile. both the single-key entries the user can make just
after entering a message, and the multi-key ("expert") entries are now
programmable.
when you have made changes to /usr/ZyXEL/commands (you should have, to
change the password) it is best to make the same changes in the newly
released version of this file, rather than attempting to update the
existing file.
- a text-to-speech synthesizer is now included. it requires quite some
CPU power, though. you may want to avoid using it when your machine
is less powerfull than a 486DX/33... a machine without floating point
coprocessor will certainly not run it satisfactorily.
When your system is incapable of running the speech synthesizer, modify
the /usr/ZyXEL/keys and /usr/ZyXEL/commands files to use "play" commands
that play pre-recorded messages, or different kinds of "beep" commands
instead of all "say" commands in the files. Examples are provided as
"keys.nosynth" and "commands.nosynth"
Also remove the SYNTH= line in /etc/default/ZyXEL.
- FAX transfer is now done in CLASS 2 mode (was ZFAX) by default. this
means incoming FAXes can be processed by g3topbm and outgoing FAXes can
be generated by Ghostscript.
The old (ZFAX) method can still be selected at compiletime.
Installation
------------
Installation should be most straightforward by unpacking everything from
the distribution tar file:
cd /
tar xvzf (path-to-your-tarfile)
This will install the program as /sbin/ZyXEL, and creates a defaults file
in /etc/defaults/ZyXEL.
Also a directory /usr/ZyXEL is created, which will hold the files used
by the program. Another location for this directory could be selected in
the /etc/defaults/ZyXEL file.
After loading the files the following setup files can be edited:
/etc/default/ZyXEL:
This file defines the behaviour of the program, and where it is to find
the files it needs. An example of such a file:
INIT="" AT&F&D3&S1&T4E0L6S2=255S13.1=1S40=120S42.6=1\r OK\r\n AT+FCLASS=8;+VIP;+FCLASS=0\r OK\r\n
MUTE=M0
READY=[1750,0,1]
STATEFILE=/usr/ZyXEL/state.%s
FIFO=/usr/ZyXEL/fifo.%s
WFCLASS=8
#DIALPREFIX=0w
#LOCKPOLL=YES
#MODEMPOLL=YES
#DEBUG=170
#
# DATA mode stuff
#
VERSION=/etc/issue
ISSUE=/etc/issue.modem
TIMEOUT=60
XOFF=NO
LOGIN=/sbin/login
LOGINENV=NO
LOGINFLAGS=-p -f
PROTECT=/etc/protect.usr
#
# FAX mode stuff
#
FAXID= +1234567890
FAXDIR=/usr/ZyXEL/fax
FAXFILE=%y%m%d-%H%M
FAXMAIL=root
FAXPOLL=/usr/ZyXEL/faxpoll/id%s
FAXCOMP=0
GHOSTSCRIPT=/usr/bin/gs
GUNZIP=/bin/gunzip
BUFFER=/usr/local/bin/buffer
PSTEXT=/usr/local/bin/pstext
#
# VOICE mode stuff
#
PLAYDIR=/usr/ZyXEL/play
RECDIR=/usr/ZyXEL/record
RECFILE=%y%m%d-%H%M
RECMODE=0
SILENCE=25,70
DROPMSG=5
SHOWMSG=AA
VOICECMD=/usr/ZyXEL/commands
VOICEKEY=/usr/ZyXEL/keys
ARCHIVE=/usr/ZyXEL/archive
APIUSERLEVEL=7
SYNTH=/usr/ZyXEL/zsynth
SYNTHFLAGS=-R -d a
#
# PAGER stuff
#
#PAGERNUM=1234567
#PAGERTYPE=31
#
# VOICE mode beeps
# avoid freqs 440 Hz, 1200 Hz, 1300 Hz and 1800 Hz
#
#ANSWERTONE=[0,0,20][420,0,15]
RECATTN=[933,0,4]
RECDONE=[1866,0,1][0,0,1][1866,0,1]
PROMPT1=[933,0,1]
PROMPT2=[1866,0,1][933,0,1]
ERROR=[500,0,3][0,0,1][500,0,3][0,0,5]
Things you may want to change in this file:
On the first line, the INIT string is defined which is sent to the
MODEM. You may want to add a P just before the first \r if your
telephone system does not allow the use of DTMF dialing. (P = Pulse
dialing)
You may also want to insert or modify settings like S40=120 (enable
distinctive ring detection) in the INIT string. Leave the other
initialization options as they are shown, at least until you fully
understand their meaning and the implications of changing them.
The command after MUTE= is sent to the MODEM before answering calls in
DATA or FAX mode. You can use M0, M1, M2 or M3 to control the behaviour
of the MODEM internal speaker. Check the ZyXEL MODEM manual.
The tone after READY= is sent when ZyXEL has started and successfully
initialized the MODEM. It will sound a short beep from the internal
speaker. comment-out this line when you don't like that.
(the 6.11a version that I am currently using beeps at a very low volume,
making this feature mostly useless. older versions sound a nice beep...)
STATEFILE and FIFO define locations of these files, and need no be
changed when you keep /usr/ZyXEL as the home location of information for
the program.
DIALPREFIX= can be used to define a fixed sequence to be sent before
each number that is dialled from ZyXEL, e.g. to get an outside line when
connected to a PABX. When it is omitted, no prefix is sent.
When you use only clean programs like Taylor-UUCP and Seyon, you can
omit the line LOCKPOLL=YES. It causes the program to wake up every 15
seconds to check for a lockfile, which is usually not necessary. Use
LOCKPOLL=YES only when you find that ZyXEL does not detect that certain
programs have been using the port.
MODEMPOLL=YES causes the MODEM to be polled every 15 seconds to see if
it is still 'alive'. (AT is sent, and OK is expected back)
You can omit this when you trust the MODEM not to silently die.
(normally ZyXEL modems don't do that, but you can include this when you
suspect your modem to be flaky)
The number after DEBUG= turns on some debugging output (will be written
to the file /tmp/ZyXEL:line), it can be commented-out as soon as
everything appears to be operating ok. More debugging output can also
be enabled, the number after DEBUG= is an octal number indicating
classes of debug output:
D_OPT 0001 /* option settings */
D_DEF 0002 /* defaults file processing */
D_UTMP 0004 /* utmp/wtmp processing */
D_CHAT 0010 /* MODEM chat (send/expect/waitfor) */
D_GETL 0040 /* get login name routine */
D_RUN 0100 /* other runtime diagnostics */
D_LOCK 0200 /* lockfile processing */
Note that debugging output is only available when the program has been
compiled with debugging enabled. This is controlled by an option in the
makefile. When the line: "DEBUG= -DDEBUG" is present in the makefile
(without #-mark), the program will be compiled with debugging enabled.
DATA mode stuff:
VERSION and ISSUE determine the message sent to the user before the
login: prompt appears. ISSUE points to the file being printed in this
case, and VERSION defines the file that can be referred to using @V in
the ISSUE file. As distributed, /etc/issue is assumed to contain the
one-line text describing the system version, and the remainder of the
info is added from /etc/issue.modem.
LOGIN= defines the program to be run when a valid username has been
entered and callback checks have been made.
LOGINFLAGS= defines the options passed to this program (before the
username). The "-p -f" options are valid for John F Haugh's shadow
login package. Your login may require different flags, or none at all.
(-p means 'preserve environment variables' and -f indicates the user-id
has already been validated by the calling program)
When LOGINENV=YES, the environment variables defined by ZyXEL will be
passed as extra arguments to LOGIN. This can be used when the LOGIN
program does not support the -p flag, and supports
"login username var=value".
FAX mode stuff:
Add your phone number after the FAXID=, it is used when answering FAX
calls. This string can be up to 25 characters.
FAXMAIL= defines a mail address where a notification message is sent
whenever a FAX arrives. When this definition is omitted, no message
is sent.
FAXPOLL= defines the name of a file to be sent when an incoming FAX
poll is detected. A %s in this string will be replaced by the POLL-ID
in the request, which is a 4-digit number. When no POLL-ID is present,
"0000" is used.
FAXCOMP= defines the FAX compression mode advertised to the remote FAX
when answering. Use FAXCOMP=0 when you want only 1-d coded FAXes to
be received. (g3topbm only supports this mode)
GHOSTSCRIPT= defines the pathname to the Ghostscript program, which is
required when directly faxing text or Postscript files.
GUNZIP= defines the pathname to the Gunzip program, which is required
when faxing gzipped Postscript files.
BUFFER= defines the pathname to a buffering program, which reads stdin,
buffers some data and writes to stdout. This is used between Ghostscript
and the FAX sending routines, to enable Ghostscript to work ahead of the
actual sending. I use "buffer" by Lee McLoughlin, found on src.doc.ic.ac.uk.
PSTEXT= defines the pathname to a program that converts plain text on
stdin to Postscript output on stdout. It is required only to FAX plain
text directly.
When you don't have one of the programs above, leave out the corresponding
variable setting. ZyXEL will not attempt to start the program in that case.
This just means the corresponding file type cannot be directly FAXed.
VOICE mode stuff:
RECMODE= defines the recording mode used for incoming messages. known
modes are:
CELP 0 (only on PLUS models)
ADPCM2 1
ADPCM3 2
ADPCM4 3 (only with firmware 6.13 and newer)
ADPCM2+RESYNC 5 (only with firmware 6.10 and newer)
ADPCM3+RESYNC 6 (only with firmware 6.10 and newer)
ADPCM4+RESYNC 7 (only with firmware 6.13 and newer)
NEW ADPCM3 8 (only with firmware 6.13 and newer)
NEW ADPCM3+RESYNC 12 (only with firmware 6.13 and newer)
Selecting CELP on a non-PLUS modem will cause recording in ADPCM2 mode.
Selecting a RESYNC mode on a modem with firmware before 6.10 will be
ignored. The corresponding mode without RESYNC will be used. Selecting
ADPCM4 with firmware before 6.13 will cause recording in ADPCM3 mode.
Note that although recording is quite adaptive, playback isn't. i.e.
recordings made in any other mode than 1 or 2 are not playable on all
available modems.
DROPMSG= defines a minimum recording time (in seconds) for an incoming
voice message to be kept. Messages shorter than this will be deleted
immediately after the recording. This is used to prevent recordings of
only the BUSY tone being kept. 5 seconds seems to be a good value.
SHOWMSG=AA enables the "incoming messages available" indication on the
"AA" LED on the MODEM. Note that the "AA" LED is normally OFF, even
when the program is in a mode where it will be answering the phone.
This is because the decision to answer the phone is made based on the
incoming RING indication, and the mode in which the program is at that
time.
When SHOWMSG=AA is in the file, the "AA" LED will be ON when a VOICE
message is present in the voice messages recording directory. This
allows you to see at a glance whether a message is waiting, without
having to check on the computer screen (which may be blanked or OFF).
APIUSERLEVEL= defines the userlevel that a user entering via the API
FIFO will automatically get. The API FIFO is the interface used by
local programs, to let ZyXEL playback VOICE messages etc. When the
APIUSERLEVEL is suitably set, a local user can playback messages without
first entering the password that would be required when doing this from
the phone.
PAGER stuff:
PAGERNUM= defines the phone number to call to activate your pager.
PAGERTYPE= defines the method to use to call a pager. different methods
can be present in the program, and they are selected by a code. the
following methods are currently defined:
31 Netherlands
Call the PAGERNUM number and wait until it answers (VOICE).
When numeric info is to be sent, wait for the end of the voice
announcement and the appearance of a DIAL tone, then send the info
using DTMF (even when local dialling is PULSE). Info is
terminated with a # sign.
Then, wait for the confirmation voice message and beep. Actually,
we cannot match that and wait for the BUSY signal which follows
immediately after the beep.
Note that the appearance of the second dialtone is dependent on
the kind of pager, and therefore it is your responsability to
configure the program (defaults file and keys/commands file) in
such a way that extra info is sent when the pager expects it, and
is not sent for a pager that does not support it.
312 Alternative for Netherlands
Call a certain number in DATA mode (2400 baud, 7 bits, even
parity), and wait for the prompt for the pager number to call
("=01="). Send the PAGERNUM number followed by RETURN.
Wait for prompt for numeric information ("=20="). Send numeric
information, followed by RETURN. Wait for confirmation ("=80=")
and disconnect.
When the above methods are not appropriate for your local situation,
an extra code has to be added to the pager() function. You could do that
yourself (please send me the patches) or send a description of how your
paging service works (similar to the descriptions above) and ask me to
implement it.
Other files that should be reviewed and edited:
/usr/ZyXEL/commands.example:
copy this file to /usr/ZyXEL/commands, and edit the numbers used as
'passwords' (123456 and 654321 in the example file) so that the
passwords you use are not so easy to guess by others :-)
/etc/inittab:
replace the line you may be currently using for the port (e.g. using
getty or uugetty) with something like the following:
s1:4:respawn:/sbin/ZyXEL ttyS1 57600
The baudrate "57600" may be too high when you use a '386 machine and
have no 16550A UART installed. You can decrease it to 38400 without
much penalty. Going down to 19200 or even 9600 will kill some of the
voice mailbox capabilities...
/etc/issue.modem:
The contents of this file are shown when a caller connects in DATA mode.
The @letter sequence is used to insert system-dependent data.
You can edit this file to direct callers towards public services
available on your system (e.g. "bbs" and "nuucp")
/etc/protect.usr:
This file defines the users that can login via the MODEM, and the
password they have to use. It can also define a telephone number to
dial back to the calling user, for enhanced security.
Because of this file, you can have restricted access via the modem,
without having to set passwords on all your accounts. Of course, you
should only allow access to restricted applications (uucp, bbs) in that
case, because a user getting a shell can simply "su" to any other user
which does not have a password...
The layout of the /etc/protect.usr file is:
username:*
username:password
locationname:password:telephone_number
The first form allows access for users logging in as "username", without
asking for a password. The second form will cause a Password: prompt to
appear, and the entered password will be checked.
When the telephone_number is also present (third form), the line is
disconnected and the specified number is then dialled. When it answers,
a connection is set up, and the user will be presented with the normal
login: prompt of the operating system, so that he can login as any user
whose password he knows.
Note that the passwords appear in plaintext, and have to be maintained
by the system administrator using a text editor. The file should
therefore be owned by "root", and have mode 600 (-rw-------).
/usr/ZyXEL/state.<linename>
This file (e.g. /usr/ZyXEL/state.ttyS1) defines the operating mode of
the program for a certain line. It consists of one to five lines with
multiple space-separated tokens. The following tokens are used:
<mode> <number_of_rings> [<alt_number_of_rings>] [R<ringback_rings>]
The <mode> defines the mode in which calls are answered. The following
values are defined:
DATA answer in DATA/FAX mode, switch to VOICE when NO CARRIER
VOICE answer in VOICE mode, switch to DATA/FAX after silence
FAX answer only in FAX mode
The <number_of_rings> sets the moment at which the program answers the
phone. In DATA mode this will usually be 1 or 2, but in VOICE mode you
may prefer to select a higher number to give some time to manually
pickup the phone when you are nearby.
For VOICE mode, an optional second <number_of_rings> may be specified.
When messages are present in the voice messages recording directory, the
phone is picked up after this second number of rings.
This can be used as a toll saver feature: specify a lower number of rings
in the second number, and when you want to check remotely if messages
are waiting, only let the phone ring as many times as specified here.
You will save the costs of a call when no messages are waiting.
Example:
VOICE 4 2
Yet another optional item is a capital letter R followed by a (small)
number of rings. When up to this number of rings are coming in and the
ringing stops before the required number of rings (the earlier numbers
on the same line) has been reached, the program switches to DATA mode
for a fixed amount of time (one minute).
This can be used to place a DATA call to the system while it is in VOICE
mode, using a modem which does not accept the voice reply and without
using DTMF.
First call the number and let it ring once or twice, then wait at least
15 seconds (at most one minute) and place a second call. The program
will now answer in DATA mode.
Example:
VOICE 4 R1
When you are using the "distinctive ring detection" option of the ZyXEL
MODEM, the "state" file should have five lines (or at least one more
than the highest ring type expected from the MODEM). In this case, the
program will use the n+1'th line of the file when RINGn is received from
the modem. Example:
VOICE 4
VOICE 4
DATA 2
MODEM will pickup in VOICE mode after 4 rings when RING or RING1 is
received, and will pickup in DATA mode after 2 rings when RING2 is
received.
A small script, /usr/ZyXEL/zstate, is provided to set or display the
contents of the statefile. this is only to be used when distinctive
ringing is not in use, as it only writes a single-line statefile. when
you have distinctive ringing, you probably never modify the statefile
anyway, and just create it using an editor.
The script is used like this:
zstate ttyS1
Displays the current content of the statefile for ttyS1, e.g. "VOICE 4".
zstate ttyS1 DATA 2
Sets the statefile for ttyS1 to contain "DATA 2".
crontab of user root:
In this crontab you can put commands to switch the mode of the program
at specified times of day. E.g. to run in DATA mode during the night,
and switch to VOICE mode during the day. Example:
0 23 * * * /usr/ZyXEL/zstate ttyS1 DATA 2
30 7 * * * /usr/ZyXEL/zstate ttyS1 VOICE 4
This will put the program in DATA mode for the period 23:00-07:30 each
day (I am using this setup for my BBS)
Firing it up
------------
After the above changes have been made, and the MODEM has been connected
and switched ON, use "telinit 4" to set the INIT runlevel to 4, which
causes the /sbin/ZyXEL program to be respawned. (use "telinit q" when the
runlevel already was at 4)
Now, you should see a quick dialogue on the MODEM TXD and RXD LEDs, and
you should hear a short BEEP from the modem to indicate successful
intialization. After this, the LEDs HS, DTR, CTS and EC should be ON,
the others should be OFF.
When this fails, the is probably a problem with the COM port or the cable
used to connect the MODEM. Checkout using a terminal program.
When you now press the DATA/VOICE button on the MODEM, it will react as
if a call came in. Depending on the STATE file contents, it will be
in VOICE or in DATA mode.
However, to be operating in VOICE mode you will need pre-recorded messages,
which you first need to record now.
Recording messages
------------------
To record your own outgoing messages proceed as follows:
1. put the program in VOICE mode (/usr/ZyXEL/zstate ttyS1 VOICE 4)
2. use one of three methods to get connected to the VOICE mailbox:
- connect a microphone to the MODEM (see manual), run the "zvmb" program,
and press V to connect to the VOICE mailbox. you will use the
machine's keyboard to enter numbers in this case, and you should not
type the * and # (use ENTER instead). enter 42 to switch the modem to
use the microphone for input.
- or call the MODEM from another phone (e.g. when you have a PBX), and after
you get a connection and the existing message has been played press '9'.
- or connect a microphone to the MODEM (see manual), and press the DATA/VOICE
button on the MODEM. Use a 'pocket tone dialer' (DTMF keypad with
loudspeaker) to generate DTMF tones in this case.
After the message has been played, press '9'.
Then type *55#, and the mailbox should answer with a short BEEP.
This phase may be a little tough as the MODEM was in 'telephone line'
mode and is not very sensitive. After the *55# is accepted the
'microphone' mode has been selected and everything should be fine.
3. enter *51# to record in CELP mode, *52# to record in ADPCM2 mode or
*53# to record in ADPCM3 mode (these give different quality and data rate)
4. wait for the BEEP, and start recording your message. The silence detection
interval is quite short now, so you should continue talking... You
can adjust the silence detection interval in the commands file, but
keep in mind that the period of silence in your recorded message will
slow down the procedure each time it is played...
When finished the BEEP-BEEP sound indicates the recording is stopped.
5. enter *41# to replay your message, and repeat the recording if not
satisfied.
6. now your message is saved in /tmp/record.zad, and you can move that file
to the proper file in the /usr/ZyXEL/play directory. the greeting to
be played when answering in VOICE mode is called "greeting.zad".
Repeat this for all the messages you want to record or replace.
You can also use .zad files created by any other software that adheres
to the .zad standard file format. (e.g ZFAX under DOS)
Remote Control
--------------
In general, the MODEM DTMF detection feature seems to be a little
insensitive just after the start of the recording. Wait a short while
after the BEEP to get better results, or first press *.
(this has gotten a lot better in recent modem firmware versions)
DTMF functions in VOICE mode are controlled by two files, defined by the
VOICEKEY and VOICECMD entries in the configuration file.
After answering in VOICE mode and playing the greeting message, the
system starts recording an incoming message and is sensitive to
single-key DTMF commands defined in the VOICEKEY file, normally
/usr/ZyXEL/keys. This file can be modified as desired. The
distributed version defines the following keys:
1 - instructions for use
2 - replay your own recorded message
3 - record a new message over previous one
4 - erase your own recorded message
5 - call the owner's PAGER (optionally with a numeric message)
6 - goto DATA mode
7 - goto FAX mode
8 - FAXBACK mode, send a FAX selected by a document number
9 - goto command mode
0 - hangup
* - ignored because * has to be pressed on many phones to enable DTMF
# - stop (message, recording), end number
The DATA and FAX mode keys switch the program to the indicated mode, and
when a connection cannot be immediately established the program keeps
this mode for two minutes. Another call coming in during this interval
will be immediately answered in the selected mode, independent of the
mode indicated in the 'state' file. This allows you to remotely switch
the program to another mode, and then make a call in that mode immediately
afterward.
The "command mode" key selects the extended command mode, in which
commands consist of a <*> <digits> <#> sequence.
All codes are numeric entries, for which the decimal value of the digits
between * and # selects the function. So, *00# is equivalent to *0#.
The * key merely erases all entries made before, effectivily clearing
the number as a startoff. It can therefore also be used when an entry
error has been made. (e.g. *52*51# gets processed as '51')
Functions in command mode are defined in the VOICECMD file, normally
/usr/ZyXEL/commands. This file can be modified as desired. The
distributed version defines the following commands:
*0# - back to VOICE mode (single-key DTMF commands active again)
*22# - switch the answering mode permanently to DATA
*23# - switch the answering mode permanently to FAX
*24# - switch the answering mode permanently to VOICE
*33# - recorded message playback
*34# - archived message playback
*41# - play newly recorded message
*42# - switch to microphone input
*43# - switch to telephone line input
*50# - record new message (CELP)
*51# - record new message (ADPCM2)
*52# - record new message (ADPCM3)
*53# - record new message (ADPCM4)
*55# - record new message (ADPCM2+RESYNC)
*56# - record new message (ADPCM3+RESYNC)
*57# - record new message (ADPCM4+RESYNC)
*58# - record new message (NEW ADPCM3)
*59# - record new message (NEW ADPCM3+RESYNC)
*61# - enter number for callback
*62# - callback selected number
others - see /usr/ZyXEL/commands
Functions in message playback mode:
0 - leave playback
1 - playback help
2 - tell message date/time
3 - next message
4 - delete message & step to next
5 - archive message & step to next
7 - first message, step forward
8 - play same message again
9 - last message, step backward
Commands used in /usr/ZyXEL/commands and /usr/ZyXEL/keys files
--------------------------------------------------------------
You can program your own actions to be performed when certain DTMF keys
are used, using a set of commands in the "keys" and "commands" files.
For each DTMF key or code, you enter a label in these files (the key
number or code, followed by a colon). At this label, a number of
commands can be specified, each on a separate line and preceded by a
TAB. The sequence of commands for a label ends when a new label is
encountered. There can be empty lines and comment lines in the file for
clarity. Comment lines start with a #-sign.
In general, commands consist of a keyword and one or more optional
parameters, separated by spaces. When parameters need to include
spaces (e.g. in the "logmesg" and "say" commands), surround the
parameter by single or double quotes.
The following commands can be used:
auplay <filename>
Used to play an audiofile with uLaw data. When the file starts
with ".snd" (SUN audio file) it is assumed to contain audio data
sampled at 8 KHz, starting from byte 32. Otherwise, it is assumed
the file has no header and contains audio data sampled at 9.6 KHz.
The <filename> should be a full pathname. Note that this command
is not for playing back ZyXEL audio files. (see "play" command)
beep
The "beep" command can be used to send audible tones. Without
parameter it will sound the tone defined as ERROR in the
/etc/default/ZyXEL file. When given a parameter, the specified
string is sent to the MODEM after a AT+VTX= command. Check your
ZyXEL manual for a description of valid strings.
Example: beep [880,0,1][0,0,1][880,0,3][0,0,5]
checklevel <num>
Used in combination with the "userlevel" command to protect
certain commands from access by unauthorized users. A
"checklevel" command will logically-AND the specified level with
the current "userlevel", and when the result is nonzero it will
proceed. When the result is zero, an error is generated and the
sequence of commands is terminated. Hence, the commands below
the "checklevel" are not executed, and are protected from users
that don't know how to set the userlevel.
The logical-AND operation means that one can in fact create a
number of different "user groups", each assigned a power-of-2
number (1,2,4,8,16 etc). The "checklevel" command specifies the
sum of the group numbers that one wants to allow access to the
commands, and the "userlevel" command specifies the sum of the
group numbers the user is to be member of.
Example: checklevel 1
command
When issued in /usr/ZyXEL/keys, the voice mailbox goes into
command (also known as "expert") mode.
dialback [<number>]
Hangs up the line, and dials the number specified in a
"readnumber" command, or the number specified.
Voice mode is assumed on the call. Can be used to reverse
charges when reading out the voice mailbox, or to test
reachability of a phone one is testing. Could also be used to
dial to some fixed number to indicate a message was entered and
the caller wants to have it handled immediately (by pressing a
certain DTMF key)
exit
Exit from the current mode. Goes back to "key" mode when in
command mode, hangs up the phone when in "key" mode.
fax <filename>|NUMBER [<number>|NUMBER]
Send a FAX. The fax to send is either a filename (or directory),
or the specified document in the FAXPOLL directory (when NUMBER
is specified, and the "readnumber" command has been used to
enter the number of the document to be FAXed).
When <number> is not given or is empty, the FAX is sent on the
current connection. Else ZyXEL hangs up the line, and calls the FAX
specified by <number> or the number keyed in using "readnumber"
when NUMBER is specified.
As there is only one NUMBER register, it is not possible to send
a numbered document to a variable number...
Example: fax /usr/ZyXEL/faxpoll/id0000
logmesg <string>
Logs the specified message to the logfile.
Example: logmesg "Interesting event"
mode <mode>
Switch to a different mode. <mode> can be:
DATAFAX - auto-detect DATA or FAX mode
DATA - DATA mode only
FAX - FAX mode only
The switched mode will be held for two minutes when the
handshake initially fails, so one can switch the system into
DATA mode calling from a phone, and then call again using a
MODEM.
Example: mode DATA
pager [<code>|NUMBER]
Hangs up the line, and calls the PAGER specified by PAGERNUM and
PAGERTYPE in the /etc/default/ZyXEL file.
<code>, when specified, will be sent to the paging service as
information to be displayed on the PAGER. When NUMBER is
specified for this argument, the number last read with a
"readnumber" command is sent as information.
play [<filename> [<endstring>]]
Plays a specified ZyXEL audio datafile to the MODEM. The file
should be in the ZyXEL-documented .ZAD format (same as used by
ZFAX). The encoding type of the file should be compatible with
the MODEM used to play it. (i.e. you can't play CELP files on a
non-plus modem, or ADPCM4 files on pre-6.13 firmware)
The optional <endstring> specifies the DTMF keys and events that
will end the playing before the end-of-file. Default value of
this <endstring> is "#bd", i.e. the playing stops when # is
pressed, or a BUSY or DIALTONE is received.
When <filename> is not a full pathname (does not start with a
slash), the file will be located in the PLAYDIR defined in the
defaults file (usually /usr/ZyXEL/play), and the .zad extension
is automatically added. When it is a full pathname, it is not
further modified.
When the <filename> is omitted, the current recording file (name
is dynamically determined at the start of the voice mailbox
session) is being played.
Example: play greeting
playback [<dirname>]
Message playback mode is entered. In this mode, files in the
specified directory are played oldest-first, and DTMF keys can
be used to step through the files, delete files, or archive
them.
When no directory name is specified, the RECDIR directory defined
in the defaults file is used. (the directory where incoming
voice messages are stored)
readnumber
A number (e.g. to be used for dialback) can be keyed in,
terminated by the # key. The * key can be used to make
corrections. The number is then read aloud, for verification of
correct entry.
This command performs no dialing, this is done by the "dialback"
command and some other commands that use it when the keyword
NUMBER is used instead of a telephone number or FAX document number.
record [<filename> [<endstring> [<vsd-string> [<vsm-value> [<maxtime>]]]]]
Record audio into a diskfile.
When no filename is specified, the current recording file (name
is dynamically determined at the start of the voice mailbox
session) is used.
The optional <endstring> determines the events that end the
recording. Default is "#bdq" (DTMF # key, BUSY tone, DIALTONE
or quiet line for the specified silence interval).
The <vsd-string> determines the silence detection parameters.
When it is omitted or empty, the SILENCE value specified in the
/etc/defaults/ZyXEL file is used.
The <vsm-value> determines the recording mode used. When it is
omitted or empty, the RECMODE value from the defaults file is
used.
Finally, the maximum time of the recording can be specified,
the default is 120 seconds.
Example: record /tmp/record.zad #bdq 20,10 0 60
recLS <LS-nr>
Sets the input device to be used for recording.
valid values are:
0 - use the device being used for playback
2 - use the telephone line
8 - use an external microphone plugged into the LINE
connector
remove [<filename>]
Removes the specified file. When no filename is specified, the
current recording file (name is dynamically determined at the
start of the voice mailbox session) is removed.
BE CAREFUL: the program runs as "root", hence any file on the
system can be removed using this command.
As only "root" can edit the command files and can issue this
command in immediate mode, there should be no security
consequences. This would change when the /etc/default/ZyXEL
file and/or the commands and keys files are publicly writable!
run [<envvar>=<value>...] <command> [<args>...]
Run an external program. Any parameters of the form VAR=value
will be put in the environment, the remainder of the line is
the program name (must be full pathname) and the arguments for
the command.
The program will be run with STDIN and STDERR attached to
/dev/null, and STDOUT attached to the speech synthesizer (when
enabled). For correct operation, the program should perform its
action, write a short text on STDOUT, and then exit. The speech
generated from the output text should be less than 2 minutes in
length, and the program itself should require less than 1 minute
runtime. Normally, the program will just be some small status
report or change.
The following strings in <args> are treated special:
@C - will be replaced by the last CONNECT received from modem
@L - will be replaced by the name of the tty (e.g. "ttyS1")
@N - will be replaced by the last string read using "readnumber"
@R - will be replaced by the name of the current recording file
@S - will be replaced by the system name
Example: run /usr/bin/fortune
BE CAREFUL with this command! The program is run with "root"
privileges.
say <string>
Call the text-to-speech synthesizer to say the specified English
text. This is best used only for short directives (e.g. mode
changes, prompts) as the quality of the speech is sub-optimal.
Example: say "expert mode"
userlevel <level>
Set the current userlevel to the specified numeric value.
This is used with "checklevel" to protect certain commands
from unauthorized access.
The protection is achieved by hiding this command under a
longish command number, so that it is unpractical for a caller
to try all possible commands until it is found.
Example: userlevel 1
The speech synthesizer
----------------------
The speech synthesizer included with the package is the "rsynth-2.0"
program by Nick Ing-Simmons. Only small patches were made to interface
it with ZyXEL.
For full documentation of the synthesizer, get the package from
svr-ftp.eng.cam.ac.uk (filename comp.speech/sources/rsynth-2.0.tar.gz).
The synthesizer can use an optional dictionary. The "mkdictdb" program
is provided to load the dictionary database from a textfile containing
english words and their pronounciation. Such a file can be found on:
ftp.cs.cmu.edu (filename project/fgdata/dict/cmudict.0.3.Z).
Uncompress it, and load it into the database using:
mkdictdb cmudict.0.3 aDict.db
mkdir /usr/lib/dict
mv aDict.db /usr/lib/dict
Some warnings about invalid words will be issued. These can be ignored.
Note that the database takes about 9 MB of diskspace...
Alternatively, a British (vs. American) version of the dictionary can
be found on the rsynth-2.0 site. See the rsynth README for more details.
With the dictionary the speech quality is much better than without, but
it still is very difficult to understand phrases which are dynamically
generated and you cannot predict beforehand. The best use of the speech
synthesizer is for confirmation strings and short prompts. It saves the
effort of having to record numerous short strings in files to be played
using the "play" command.
Using "zvmb"
------------
"zvmb" is a very simple program, which was mainly developed to test
the API FIFO interface of the program. A more friendly program has
to be developed for user interaction.
However, zvmb is now usable to do some interaction with the VOICE
mailbox, and it is more comfortable that the earlier method, which
worked by connecting a microphone and using a DTMF keypad to issue
commands...
When "zvmb" has been started, it tells you how to quit from it:
ZyXEL VoiceMailBox user interface - Hit RETURN for MENU
Use ^C to quit
Please remember this :-) (it is the INTR key defined for your terminal,
when ^? appears, the DEL key is meant)
You can press ENTER to get a menu of available commands:
ZyXEL 1.5 (Feb 4 1995 02:03:42) (c) 1993,1994 by Rob Janssen, PE1CHL
Commands are:
! Print ZyXEL pid
# Print program version
$ Print MODEM version
> Set output fifo/file/tty
S Use SPEAKER for playback (default)
L Use LINE for playback
V Access VoiceMailBox
C<command> Execute VoiceMailBox command
P<file> Playback
R<n> Record over line <n>
F<number> <file> Send a FAX
Q<number> <id> Poll for FAX
D Hold DATA/FAX mode for 5 minutes
AT<cmd> Issue MODEM command
Typing one of these commands followed by <return> or <space> will
perform the indicated action.
The commands !, #, $ and > are intended for use by "pretty" user
interfaces, e.g. using Tcl/Tk. An example of such an interface is now
included, but it needs some more work. Don't hesitate to volunteer :-)
S and L are used to set the output device for VOICE mailbox message
playback. Messages can be played back through the MODEM internal
speaker, or to a speaker or telephone handset connected to the LINE
terminal of the MODEM (see MODEM manual, end of chapter 14).
The internal speaker is attractive because it requires no plugging or
switching of the line, but the quality of playback is awful. Use the
LINE option for HI-FI playback :-) (but you need to connect a handset)
V is used to access the VOICE mailbox. You will be dropped into the
mailbox at the point where you normally are after listening to the
announcement message, and pressing 9 to enter command mode.
Your userlevel will have been set according to the APIUSERLEVEL=
line in the /etc/default/ZyXEL file, so that you will not have to
enter the password code in personal-use environments. (APIUSERLEVEL=7)
Now, you can enter any code defined in the /usr/ZyXEL/commands file,
and enter 0 to exit from the VOICE mailbox.
When the default commands file is in place, 33 will enter the message
playback mode, where you can handle messages that have arrived.
F is used to send a FAX. First, you need to prepare the outgoing FAX,
depending on the type of FAX support that was compiled in the program.
(See the FAX subheading for more details)
Then send the FAX by typing: F number faxfile [ENTER], e.g.:
F 030715610 /tmp/faxfile
The faxfile pathname must be a full pathname, as it is interpreted by
the running ZyXEL program which does not have the same working directory
as "zvmb" has.
The result of sending the FAX is reported, you will have to re-try when
it fails.
Q is used to poll for an incoming FAX. Type Q number id <ENTER> to call
the specified number and ask for a FAX. When it is available, it will
be received and stored in the incoming FAX directory.
the "id" is a 4-digit number which will be sent to the remote FAX as a
poll id. Use 0000 when you don't know which ids it handles, often the
id will not even be used.
Example: Q 030715610 0000
The D command can be used to enable DATA mode calling for a brief time.
E.g. someone wants to access your BBS or UUCP dialin, and has called
you about this. Now, you can start "zvmb", issue the D command and
leave "zvmb" again. The modem will answer in DATA mode when a call
comes in within 5 minutes.
Any line starting with A will be sent to the modem, allowing some AT
commands to be issued to print the modem status.
ATI2 will print the ZyXEL LINK STATUS REPORT, reporting the statistics
for the last DATA-mode CONNECT. Just for the curious... :-)
Note that an AT command that will set some mode of the modem will be
cancelled as soon as "zvmb" is terminated, as the modem is re-initialized
at that time...
FAX
---
Up to the 1.4 version of the program exclusively uses the ZFAX mode of
sending and receiving FAXes. Support for CLASS 2 mode is in version 1.5.
The FAX mode can be selected when compiling the program from source, see
the README file in the source kit. CLASS 2 is selected in the binary
distribution, as it provides more features (most notably, while sending
FAXes). However, ZFAX mode can be used when you want to conveniently
handle FAXes on machines with little memory.
When the program has been compiled to support ZFAX:
To prepare FAXes for sending, and to decode the received FAX files,
one needs to use the ZFAX program which is distributed by ZyXEL with
the modem (and updated versions are available from ftp.zyxel.com).
This program unfortunately runs under DOS, but it works well under the
newer releases of "dosemu". When you have configured "dosemu" to do
direct access to the video card you can view FAXes directly. If not,
you can still convert them to printer files or PCX files, and process
these with other tools.
When the program has been compiled to support CLASS 2 FAX:
The FAXes to be sent can be in various different formats. A FAX can be
a single file, or it can be a directory containing a mix of files of
different types. When you put the files in a directory, use a naming
convention so that the pages will go out in sequence when the files are
sorted alphabetically. (e.g. name the files p01.g3, p02.g3 etc)
A file to be FAXed can be of the following types:
1. plain G3 file, without header information.
As ZyXEL cannot determine the resolution and coding from the file,
use the following naming convention to help it:
Normal resolution, 1-d coding: filename_n1.g3
Normal resolution, 2-d coding: filename_n2.g3
Fine resolution, 1-d coding: filename_f1.g3
Fine resolution, 2-d coding: filename_f2.g3
^^^^^^
2. Digifax file, as produced by Ghostscript, with one or more pages in
the file.
These formats are preferred when the system is slow, as they can be
sent to the MODEM without any conversion. Conversion while sending
is timing-critical, as there are quite short timeouts in the FAX
protocol. When using Ghostscript, a single outputfile can be used
containing all the pages (some other FAX packages need a separate
file for each page). Use this command to prepare a file using
Ghostscript:
gs -sDEVICE=dfaxhigh -sOutputFile=faxfile.g3 -q -dNOPAUSE - <input.ps
Instead of "dfaxhigh", "dfaxlow" can also be used (normal resolution
mode).
Note that the resolution should match the resolution negotiated
during connect with the remote FAX. When you use high resolution and
the remote FAX does not support it, the transfer will fail.
3. Postscript file.
4. gzip'ed Postscript file.
These formats are converted to FAX files by running "gs" with options
similar to those shown above as a process forked by ZyXEL. The
advantage of this method is that the resolution (normal/fine) can be
dynamically determined at the moment the connection is made, and
therefore the formatting is always correct.
However, formatting a Postscript page can take quite some time, and
this may cause timeouts. There is usually no problem with simple
text documents, but there may be trouble when there are complicated
drawings, especially on the first page.
(on subsequent pages, Gostscript has had time to work during the time
it takes to transfer the first page)
5. Shell script
When a file starts with #! and is executable, it will be executed and
the output it produces on stdout will be formatted by Ghostscript.
This provides the mechanism to send dynamically generated FAXes, mainly
useful for polling and faxback.
To send normal text, convert it to Postscript inside the script, e.g.
using "pstext" or "nenscript". It is also possible to include a
short Postscript program at the beginning of the output that does the
conversion.
6. Plain text
Files that look like plain text (not one of the above types, and the
first 4 bytes are in the range 01-7F) are converted to Postscript by
executing the "pstext" program, and then fed to Ghostscript for
conversion to FAX format.
The file types are not determined by the filename (except for the normal/
fine and 1-d/2-d selection for raw G3 data), but by content of the first
bytes of the file. Hence, it is possible to use files without extension.
Recevied FAXes are stored as a series of files in a directory, and can
be viewed by processing the data with g3topbm, e.g.:
g3topbm <file | xv -
Calling out
-----------
To use the modem to place an outgoing call, you will have to use the
/dev/ttySx device, i.e. the same device as the ZyXEL program is also
using to access the modem. You may have been using /dev/cuax until now,
to let the system arbitrate between incoming and outgoing calls on the
modemline. However, this arbitration is based on the availability of
the DCD signal to indicate an incoming call, and the ZyXEL modem does
not provide this signal in VOICE mode.
Therefore, the program has to operate the serial port in a different
mode than getty does, and you cannot make use of the /dev/cuax device.
Other programs that allow the use of the ZyXEL modem with Linux have the
same characteristic.
To prevent problems when another program opens the serial port while the
ZyXEL program is busy chatting with the modem, or vice-versa, a lock
file has to be created in a pre-defined place. The presence of this
file indicates that the line is in use.
This lockfile is correctly created by programs like uucico, cu, seyon.
Your favorite terminal program may need to be configured to create (and
check) the lockfile. Check this out when you notice that the ZyXEL
program interferes with your use of the modem.
The directory, name and contents of the lockfile can be configured
while compiling the program. On a Linux system, these files usually
live in /usr/spool/uucp, and are named LCK..ttySx (to match the name
of the line the modem is on). The contents of the file are the PID
of the program that is actively using the MODEM at that time, as an
ASCII string. Alternatively, the PID may be written in the file in
binary (4 bytes).
On UNIX system 5 release 4, the lock files are in /usr/spool/locks,
are named LK.dev.major.minor (to match the device, major and minor
numbers of the tty node), and the contents are also the ASCII PID.
This behaviour can be selected at compile time using the symbol
SVR4LOCKS in the source.
To get the correct modem settings when calling out, store them in the
modem's profile 0. The ZyXEL program sets AT&D3 during initialization,
so whenever a program wants to call out, it can just make DTR low for a
moment to cause a modem reset and restore of settings from profile 0.
Just calling out without a modem reset will not work, because the ZyXEL
program keeps the modem in VOICE mode while waiting for rings. When the
program you use to call out cannot lower DTR during initialization, you
should send the ATZ command to reset the modem before sending the dial
command.
Suitable settings for storage in profile 0 could be:
AT&F <- reset to factory defaults
ATS42.6=1 <- no RINGING response (confuses some programs)
ATS48.2=1 <- send DATA CNG tone when calling out
ATP <- only when pulse-dialling required
AT&W0 <- write this in profile 0
Add other settings as you prefer. Don't issue this sequence as part of
the initialization procedure of your program, as you will wear out the
EEPROM used for saving profiles. The AT&W0 command should be used only
manually.